'use strict';

module.exports = app => {
  const { STRING, UUID, UUIDV4, INTEGER } = app.Sequelize;

  const model = app.model.define('customer', {
    id: {
      type: UUID,
      primaryKey: true,
      defaultValue: UUIDV4,
      comment: '主键',
    },
    name: {
      type: STRING,
      comment: '姓名',
    },
    source: {
      type: STRING,
      comment: '来源',
    },
    type: {
      type: STRING,
      comment: '客户类型',
    },
    category: {
      type: STRING,
      comment: '客户性质',
    },
    result: {
      type: STRING,
      comment: '初步结果',
    },
    cooperation: {
      type: STRING,
      comment: '合作方式',
    },
    address: {
      type: STRING,
      comment: '客户地址',
    },
    remark: {
      type: STRING,
      comment: '详细描述',
    },
    tel: {
      type: STRING,
      comment: '电话',
    },
    userid: {
      type: STRING,
      comment: '电话',
    },
    qq: {
      type: STRING,
      comment: 'qq',
    },
    remark: {
      type: STRING,
      comment: '备注'
    },
    province: {
      type: STRING,
      comment: '省份'
    },
    city: {
      type: STRING,
      comment: '城市'
    },
    files: {
      type: STRING(2000),
      comment: '附件'
    },
    dept: {
      type: STRING,
      comment: '单位'
    },
    created_userid: {
      type: STRING,
      comment: '用户主键信息',
    },
  }, {
    tableName: 'customer',
    comment: '客户表',
  });

  return model;
};
